Repository navigation
fix(reports): a report's PDF reaches DOCiD once its embargo ends - #1694
Merged
Merged
Conversation
A deposit carries the PDF only when anyone may get it, and DOCiD's update route can't add a file. When a report DOCiD already holds opens (an embargo ending, or a reviewer opening a private file), the registrar now adds its PDF to the record through doi-sync-core's addFile, which looks for it on the record first so a retry never mints a second Handle. The file's Handle is kept on the report's DOCiD registration (fileHandle), so it is never sent again. A PDF over DOCiD's 25 MB limit is left out: the registration is done and its error says why. Every add is logged with DOCiD's answer and the Handle.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A report published with an embargo never got its PDF on DOCiD. The deposit sends the file only when anyone may get it, which is right, since DOCiD shows everything it holds. But when the embargo ended,
openEmbargoesregistered the report again and the registrar only called DOCiD's update, which sends title, description and DOI. The file never arrived.What changes:
addFile(feat(docid): add a file to a deposited record, once doi-sync-core#25, pinned at its merge commit). DOCiD gives the file a Handle of its own.addFilereads the record's files first, so a try whose answer was lost, or a file the deposit already carried, is found and never sent again. The file's Handle is kept on the report asregistrations.docid.fileHandle, so later registrations don't ask at all. A deposit that carries the file records the record's own Handle there.report-docid-file-too-large.report-docid-file-addbefore the call,report-docid-file-addedwith DOCiD's answer (heldoradded), the file's id and its Handle.Crossref and Zenodo already handle the embargo and are unchanged.
Data:
registrations.docid.fileHandleis a new optional field, so no migration is needed. Reports DOCiD holds with a file from before this change get the lookup once on their next registration and keep the Handle they find.Checks:
npx tsc --noEmit,npm run check:convex-rules, and vitest onconvex/reports/{registration,identifiers,paper,activation}.test.ts(80 passed). The new registrar test runs the real action against a stubbed DOCiD. It covers an embargo ending, a re-registration that sends nothing, a lost answer that finds the file, and a PDF over 25 MB. It fails with the add-file step switched off. The cross-family review (GPT-6.1 Sol) found two issues, both fixed in doi-sync-core#25: matching DOCiD's stored file name, and looking for a held file before the size limit.